<?php

namespace App\Models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 案卷目录
 * Class BookTitle
 */
class BookTitle extends Model
{
    use SoftDeletes;

    protected $guarded = ['id'];

    protected $table;

    public function setTable($table)
    {
        $this->table = $table;

        return $this;
    }

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function catalogs()
    {
        return $this->hasMany(BookCatalog::class);
    }

}
